<template>
  <view>
    <rich-text :nodes="agreement.content" user-select space />
  </view>
</template>

<script setup lang="ts">
import Taro, { useDidShow } from '@tarojs/taro';
import { ref } from 'vue';
import { RichText } from '@tarojs/components';
import { getAgreementApi } from '@/api/platform';

const agreement = ref({ title: '', content: '' });
useDidShow(() => {
  const { type, title } = Taro.getCurrentInstance().router.params;
  Taro.setNavigationBarTitle({ title });
  getAgreementApi({ type }).then((res) => {
    agreement.value = res.result.value;
  });
});
</script>

<style lang="less" scoped></style>
